package com.itheima.utils;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Result<T> {
    private Integer code;
    private String msg;
    private T data;

    public static <T> Result success(T data) {
        return new Result(1,null,data);
    }

    public static <T> Result error(String msg) {
        return new Result(0,msg,null);
    }
}
